/**
 * @module      config
 * @author      nayoayo
 * @date        2023/4/23 9:33 AM
 * @version     1.0
 */

export let GConfig = {
    requiredPosition: 'left',
    labelPosition: 'left',
    isTrack: true,
    errorMessageHook: (message) => {
        return message
    }
};

export const stepForm = (options) => {
    GConfig = Object.assign(GConfig, options);
};

export const setProps = (type, gcKey = undefined, required = false) => {
    let prop = {type, required}
    if (gcKey) {
        prop.default = () => {
            return GConfig[gcKey]
        }
    }
    return prop;
};

export default GConfig;
